<?php
/**
 * @author @author Samrat Khan & Sadik Sarfaraz - Apr 10, 2013
 */
    require('top.inc.php');
?>
<?php
if(isset($_SESSION['user']) && $_SESSION['user']['utype'] == 1) {
    $rows = getUsers(ASC, "username", $db);
    echo "<h5>User Information</h5>";
    echo "<table class=\"row-fluid table table-striped table-bordered\">";
            echo "<tr>";
                echo "<th>";
                    echo $wms_users['username'];
                echo "</th>";
                echo "<th>";
                    echo $wms_users['email'];
                echo "</th>";
                echo "<th>";
                    echo $wms_users['cus_id'];
                echo "</th>";
                echo "<th>";
                    echo $wms_users['utype'];
                echo "</th>";
                echo "<th>";
                    echo $wms_users['inserteddate'];
                echo "</th>";
            echo "</tr>";
            
        foreach ($rows as $row) {
            echo "<tr>";
                echo "<td>";
                    echo $row['username'];
                echo "</td>";
                echo "<td>";
                    echo $row['email'];
                echo "</td>";
                echo "<td>";
                    echo getCustomer($row['cus_id'], $db);
                echo "</td>";
                echo "<td>";
                    echo getUserType($row['utype'], $db);
                echo "</td>";
                echo "<td>";
                    echo $row['inserteddate'];
                echo "</td>";
            echo "</tr>";
        }
    echo "<table>";
} else {
    header("Location: login.php");
}
?>

<?php
    include ('bottom.inc.php');
?>